import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
	state:{
		playersListId:[],
		nextId:''
	},
	mutations:{
		INIT_TOPLISTIDS(state, payload){
			state.playersListId = payload
		},
		NEXT_ID(state, payload){
			for(let i = 0; i < state.playersListId.length; i++){
				if(state.playersListId[i].id == payload){
					state.nextId = state.playersListId[i + 1].id
				}
			}
		}
	}
})